package editAir.buildEdit
{
	import _Pan3D.program.Shader3D;
	
	public class BuildEditDisplay3DSpriteShader extends Shader3D
	{
		public static var BUILD_EDIT_DISPLAY3D_SPRITE_SHADER:String = "BUILD_EDIT_DISPLAY3D_SPRITE_SHADER";
		public function BuildEditDisplay3DSpriteShader()
		{
			vertex = 
				"m44 vt0, va0, vc4 \n" +
				"m44 op, vt0, vc0 \n" +
				
				"m44 v7, va0, vc12 \n" +
				
				
				"mov v1, va1 \n"+
				"mov v6, va0 \n" +
				"mov v2, va2";
			fragment =
				"tex ft0, v1, fs1 <2d,clamp,repeat>\n"+
				"dp3 ft2.x,fc0,v2\n"+
				"mul ft2.x,ft2.x,fc1.w\n"+
				"mul ft2,ft0,ft2.x\n"+
				"add ft0,ft0,ft2\n"+
				"add ft0,ft0,fc1\n"+
				
				
				"mov ft5,v7\n"+
				"div ft5,ft5,ft5.z \n"+
				"neg ft5.y,ft5.y \n"+
				"add ft4,ft5,fc2.z \n"+
				"tex ft5, ft4, fs0 <2d,2d,2d>\n"+  
		
				
				"sub ft6.w,fc2.w,ft5.w\n"+
				"mul ft0.xyz,ft0.xyz,ft6.w\n"+
				"mul ft5.xyz,ft5.xyz,ft5.w\n"+
				"add ft0.xyz,ft0.xyz,ft5.xyz\n"+
				
			
				
				"mov oc, ft0"
		}
	}
}